//package com.dykj.fireFighting.web.devhis;
//
//import com.alibaba.fastjson.JSON;
//import com.dykj.fireFighting.api.elasticsearch.devHis.service.EsDevHisService;
//import com.dykj.fireFighting.api.elasticsearch.devHisZc.service.EsDevHisZcService;
//import com.dykj.fireFighting.api.socialUnit.devicemanger.entity.Device;
//import com.dykj.fireFighting.common.core.api.CommonResult;
//import com.dykj.fireFighting.common.starter.redisson.service.RedisService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiImplicitParam;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.dubbo.config.annotation.DubboReference;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//@Slf4j
//@Api(value = "ES测试接口", tags = {"ES测试接口"})
//@RestController
//@RequestMapping("ts/a")
//public class DevHisTestController {
//    @DubboReference
//    private EsDevHisZcService esDevHisZcService;
//    @DubboReference
//    private EsDevHisService esDevHisService;
//    @Autowired
//    private RedisService redisService;
//    @GetMapping("/get")
//    public CommonResult mapping() {
//        esDevHisService.createMapping();
//        return CommonResult.success("成功");
//    }
//
//    /**
//     * redis中获取设备，实时数据用
//     */
//    @ApiOperation(value = "redis中获取设备", notes = "redis中获取设备")
//    @ApiImplicitParam(paramType = "path", name = "relationId", value = "relationid", dataType = "String", required = true)
//    @GetMapping("/getInfo/{relationId}")
//    public CommonResult<Device> getInfo(@PathVariable("relationId") String relationId){
//        Device device = JSON.parseObject((String) redisService.get(relationId), Device.class);
//        if (device == null) {
//            return CommonResult.failed("无数据");
//        }
//        return CommonResult.success(device);
//    }
//
//}
